<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>设置考试时间</title>
    <style>
        body {
            font-family: 'Arial', sans-serif;
            background-color: #f4f4f4;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }

        .container {
            background-color: white;
            padding: 2rem;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 400px;
        }

        h1 {
            font-size: 1.5rem;
            margin-bottom: 1.5rem;
            color: #333;
            text-align: center;
        }

        label {
            font-size: 1rem;
            color: #555;
            margin-bottom: 0.5rem;
            display: block;
        }

        select, input[type="text"], input[type="number"] {
            width: 100%;
            padding: 0.75rem;
            font-size: 1rem;
            margin-bottom: 1rem;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-sizing: border-box;
        }

        button {
            width: 100%;
            padding: 0.75rem;
            font-size: 1rem;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            background-color: #007bff;
            color: white;
            margin-top: 1rem;
        }

        button:hover {
            background-color: #0056b3;
        }

        .form-group {
            margin-bottom: 1rem;
        }

        .form-group:last-child {
            margin-bottom: 0;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>设置考试时间</h1>
        <form method="POST" action="{{ url_for('set_exam_time', username=username) }}">
            <div class="form-group">
                <label for="exam_name">考试名称:</label>
                <input type="text" id="exam_name" name="exam_name" required>
            </div>
            <div class="form-group">
                <label for="class_name">选择班级:</label>
                <select id="class_name" name="class_name" required>
                    {% for class_name in classes %}
                        <option value="{{ class_name }}">{{ class_name }}</option>
                    {% endfor %}
                </select>
            </div>
            <div class="form-group">
                <label for="exam_duration">考试时长 (分钟):</label>
                <input type="number" id="exam_duration" name="exam_duration" required>
            </div>
            <button type="submit">设置考试时间</button>
        </form>
    </div>
</body>
</html>
